// formPackage/pages/team/personalPerformanceDetail/personalPerformanceDetail.js
import { getMyPerformanceDetail } from "../../../../service/team_service"
let app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    themeStyle: "",
    detailId: "",
    detailData: {},
    recommendData: {},
    records: [],
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      detailId: options.id,
    })
    this.getMyPerformanceDetail();
  },



  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    if (app.globalData.themeStyle) {
      this.setData({
        themeStyle: app.globalData.themeStyle
      })
    }
  },
  getMyPerformanceDetail() {
    wx.showLoading();
    getMyPerformanceDetail(this.data.detailId).then(res => {
      wx.hideLoading();
      console.log("JJLog:业绩详情是:" + JSON.stringify(res));
      if (res.code == 200) {
        this.setData({
          detailData: res.data,
          recommendData: res.data.recommend,
          records: res.data.records
        })
      }
    }).catch(err => {
      wx.hideLoading();
      wx.showToast({
        title: err || "查询失败",
        icon: "none"
      })
      console.error("JJLog:getMyPerformanceDetail", err);
    })
  },









})